public class test2 {
    static void main() {
        int[] arr = {1, 2, 3, 4, 5};
        int temp= arr[0];
        arr[0] = arr[4];
        arr[4] = temp;
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+" ");
        }

    }
}
